package com.tinyshardingjdbc.tinyshardingjdbc.shardingasync.annotaion;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tinyshardingjdbc.tinyshardingjdbc.shardingasync.core.Processor;
import com.tinyshardingjdbc.tinyshardingjdbc.shardingasync.core.SqlProcessor;
import com.tinyshardingjdbc.tinyshardingjdbc.shardingasync.tool.TinyApplicationContext;


public class TinyShardingJdbcVo {
    private TinyShardingJdbc tinyShardingJdbc;
    private String sql;
    private String type;
    private Class classType;
    private String filed;
    private String tableStart;
    private String tableEnd;
    private SqlProcessor sqlProcessor;
    private boolean isPage;
    private IPage<?> page;
    private String tableName;
    private int hashCount;


    public TinyShardingJdbcVo(TinyShardingJdbc tinyShardingJdbc) {
        this.tinyShardingJdbc = tinyShardingJdbc;
    }

    public TinyShardingJdbcVo(TinyShardingJdbc tinyShardingJdbc, String sql, Class classType, boolean isPage, IPage<?> page) {
        this.tinyShardingJdbc = tinyShardingJdbc;
        this.sql = sql;
        this.classType = classType;
        this.type = tinyShardingJdbc.type();
        this.filed = tinyShardingJdbc.filed();
        this.tableStart = tinyShardingJdbc.tableStart();
        this.tableEnd = tinyShardingJdbc.tableEnd();
        this.tableName = tinyShardingJdbc.tableName();
        this.sqlProcessor = TinyApplicationContext.getBean(Processor.class);
        this.page = page;
        this.isPage = isPage;
        this.hashCount = tinyShardingJdbc.hashCount();
    }


    public int getHashCount() {
        return hashCount;
    }

    public void setHashCount(int hashCount) {
        this.hashCount = hashCount;
    }

    public IPage<?> getPage() {
        return page;
    }

    public String getTableStart() {
        return tableStart;
    }

    public void setTableStart(String tableStart) {
        this.tableStart = tableStart;
    }

    public String getTableEnd() {
        return tableEnd;
    }

    public void setTableEnd(String tableEnd) {
        this.tableEnd = tableEnd;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public boolean isPage() {
        return isPage;
    }

    public void setPage(IPage<?> page) {
        this.page = page;
    }

    public void setPage(boolean page) {
        isPage = page;
    }

    public void setPage(Page page) {
        this.page = page;
    }

    public SqlProcessor getSqlProcessor() {
        return sqlProcessor;
    }

    public void setSqlProcessor(SqlProcessor sqlProcessor) {
        this.sqlProcessor = sqlProcessor;
    }

    public TinyShardingJdbc getTinyShardingJdbc() {
        return tinyShardingJdbc;
    }

    public void setTinyShardingJdbc(TinyShardingJdbc tinyShardingJdbc) {
        this.tinyShardingJdbc = tinyShardingJdbc;
    }

    public String getSql() {
        return sql;
    }

    public void setSql(String sql) {
        this.sql = sql;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Class getClassType() {
        return classType;
    }

    public void setClassType(Class classType) {
        this.classType = classType;
    }

    public String getFiled() {
        return filed;
    }

    public void setFiled(String filed) {
        this.filed = filed;
    }
}
